package com.sqstudio.exercise.chapter3{
	
	import flash.events.Event;
	
	import org.papervision3d.objects.primitives.Plane;
	import org.papervision3d.view.BasicView;

	[SWF(width="800",height="600")]
	/**
	 *平面 
	 * @author Nestor
	 * 
	 */	
	public class PlaneExample extends BasicView
	{
		private var plane:Plane;
		public function PlaneExample(viewportWidth:Number=800, viewportHeight:Number=600, scaleToStage:Boolean=true, interactive:Boolean=false, cameraType:String="Target")
		{
			super(viewportWidth, viewportHeight, scaleToStage, interactive, cameraType);
			stage.frameRate = 40;
			init();
			this.startRendering();
		}
		
		private function init():void{
			this.plane = new Plane(null,300,300,3,2);
			scene.addChild(this.plane);
			this.plane.material.doubleSided = true;
			this.plane.x = 100;
			this.plane.y = 200;
			this.plane.z = 300;
			
			var len:int = plane.geometry.vertices.length;
			trace(len);
			for(var i:int=0;i<len;i++){
//				trace("x:"+plane.geometry.vertices[i].x,"y:"+plane.geometry.vertices[i].y,"z:"+plane.geometry.vertices[i].z);
			}
			
//			plane.geometry.vertices[0].x = 50;
		}
		
		override protected function onRenderTick(event:Event=null):void
		{
			
//			this.plane.localRotationY ++;
			super.onRenderTick(event);
		}
	}
}
